const callbackToPromise = func => {
  return new Promise((resolve, reject) => {
    try {
      func(resolve);
    } catch (error) {
      reject(error);
    }
  });
};

export default callbackToPromise;
